package FileIO.ReaderWriter;

import java.io.*;

public class useOutputStreamWriter {
    public static void main(String[] args) throws IOException {
        Writer writer = new OutputStreamWriter(new FileOutputStream("src/main/data/hello.txt"), "GB2312");
        try {
            String str = "hello, 123, 老妈";
            writer.write(str);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            writer.close();
        }
    }
}
